package com.ibangnuo.manage.controller.employee;

import com.ibangnuo.api.employee.AssistantControllerApi;
import com.ibangnuo.framework.domain.request.employee.AssistantRequest;
import com.ibangnuo.framework.model.response.QueryResponseResult;
import com.ibangnuo.manage.service.employee.AssistantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:ly
 * @Data:2019/12/30 10:36
 * @Verdion:1.0
 */
@RestController
@RequestMapping("/assistantEntity")
public class AssistantController implements AssistantControllerApi {

    @Autowired
    private AssistantService assistantService;

    //店员查询
    @Override
    @PostMapping("/userQuery")
    public QueryResponseResult userQuery(@RequestBody AssistantRequest assistantRequest) {
        return assistantService.userQuery(assistantRequest);
    }

    //店员添加
    @Override
    @PostMapping("/addAssistant")
    public QueryResponseResult addAssistant(@RequestBody AssistantRequest assistantRequest) {
        return assistantService.addAssistant(assistantRequest);
    }

    //店员删除
    @Override
    @GetMapping("/delUser/{assistantNumber}")
    public QueryResponseResult delAssistant(@PathVariable("assistantNumber") String assistantNumber) {
        return assistantService.delAssistant(assistantNumber);
    }

    //店员信息回显
    @Override
    @GetMapping("/findById/{assistantNumber}")
    public QueryResponseResult findById(@PathVariable("assistantNumber") String assistantNumber) {
        return assistantService.findById(assistantNumber);
    }

    //店员编辑
    @Override
    @PostMapping("/upAssistant")
    public QueryResponseResult upAssistant(@RequestBody AssistantRequest assistantRequest) {
        return assistantService.upAssistant(assistantRequest);
    }




}
